import Vue from "vue"
import VueRouter from 'vue-router'

// 引入组件
const Login = () => import('@/components/login/Login.vue')
const Home = () => import('@/components/home/Home.vue')

Vue.use(VueRouter)

// 路由数组
const routes = [
  {
    path: '',
    redirect: '/login'
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/home',
    component: Home
  }
]

// 路由对象
const router = new VueRouter({
  routes,
  mode: 'history'
})

export default router